Skip to content

Label Pi and Droid user messages as the user's (release 3.19.1) - #121

Merged
sagnik11 merged 2 commits into
mainfrom
claude/pi-droid-user-roles
Dec 5, 2026
Merged

sagnik11 merged 2 commits into
mainfrom
claude/pi-droid-user-roles

Conversation

@sagnik11

@sagnik11 sagnik11 commented Dec 5, 2026 •

Copy link
Copy Markdown
Member

Why

Pi and Droid write transcript events as {"type":"message","message":{"role":"user",...}}. event_role in src/authorship/cas_bridge.rs read type before message.role. Because type is "message", it fell through to assistant, so every user message from these agents was stored as the assistant's words. On Autter's PR page, a person's prompt showed as the assistant speaking.

Change

event_role now reads the most specific field first:

  1. a top-level role (Codex, Cursor);
  2. then message.role (Claude Code, Droid, Pi);
  3. then type (Claude Code's "user"/"assistant", Gemini).

A role other than user or assistant still falls through to the next field, as before. That covers system, tool, developer and Pi's toolResult.

Agents checked

Using the fixtures in tests/fixtures and the existing shapes:

  • Pi and Droid change: their user messages are now User.
  • Claude Code, Codex (including response_item), Cursor and Gemini are unchanged.
  • Pi toolResult events stay labelled assistant, as before.

Tests

  • 4 new unit tests: Pi and Droid user and assistant messages, plus regression tests for Claude Code and Codex.
  • cargo test --lib: 2528 passed. One failure is the known Windows symlink test, compute_watermarks_uses_symlink_metadata_not_target_mtime.
  • Integration: droid 18, claude_code 24 and codex 37 passed. The pi tests are #[ignore]d and were not run.
  • cargo clippy --all-targets and rustfmt --check are clean for cas_bridge.rs.

No version bump. It can go out with the next release.

Release

Also bumps the version to 3.19.1 with a CHANGELOG entry (6ed3494). Merging this tags v3.19.1 and publishes the GitHub release and @autter/cli 3.19.1.

🤖 Generated with Claude Code


Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

event_role read event.type before event.message.role. Pi and Droid write
{"type":"message","message":{"role":"user"}}, so every user message was
labelled assistant. The role now comes from event.role, then
event.message.role, then event.type. Other agents are unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@blacksmith-sh

blacksmith-sh Bot commented Dec 5, 2026 •

Copy link
Copy Markdown
Contributor

Found 6 test failures on Blacksmith runners:

Failures

Test View Logs
[elevated] elevated service is running/[elevated] elevated service is running View Logs
[elevated] elevated service is running/[elevated] elevated service is running View Logs
[elevated] the elevated service is untouched by the standard-user attempts/
[elevated] the elevated service is untouched by the standard-user attempts
View Logs
[elevated] the elevated service is untouched by the standard-user attempts/
[elevated] the elevated service is untouched by the standard-user attempts
View Logs
[upgrade] install.ps1 started the service again as a new process/
[upgrade] install.ps1 started the service again as a new process
View Logs
[upgrade] install.ps1 started the service again as a new process/
[upgrade] install.ps1 started the service again as a new process
View Logs

Fix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

…ser's

Pi and Droid put a message's role under message.role, so stored
transcripts showed their user messages as assistant messages. The role
is now read from the event's role, then message.role, then type.

Tests: cargo check --locked passes (3 existing lib warnings). Code
change and its tests are in 12b4c1f.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@sagnik11 sagnik11 changed the title fix(transcripts): Pi and Droid user messages are labelled user Label Pi and Droid user messages as the user's (release 3.19.1) Dec 5, 2026
@sagnik11
sagnik11 merged commit 5ce691b into main Dec 5, 2026
7 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant